﻿using System.Web;
using System.Web.Mvc;
using BitworkStudios.Web.Mvc.Framework.Navigation;

namespace BitworkStudios.Web.Mvc.Framework.Controller
{
    public abstract class ControllerBase : System.Web.Mvc.Controller
    {
        private Menu _navigation;
        protected Menu Navigation
        {
            get
            {
                if (_navigation == null)
                {
                    _navigation = new Menu(System.Web.SiteMap.RootNode);
                }

                _navigation.CurrentSiteMapNode = System.Web.SiteMap.CurrentNode;
                return _navigation;
            }
        }
    }
}
